import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

// 挂载全局组件
// 生成表单
import publicform from '@/components/publicform';
Vue.component(publicform.name, publicform)
// 表单查询
import indexselect from '@/components/publicform/indexselect.vue';
Vue.component(indexselect.name, indexselect)
// 分页器
import pagination from '@/components/pagination';
Vue.component(pagination.name, pagination)
// 卡片
import card from '@/components/card';
Vue.component(card.name, card)
// 表格
import publictable from '@/components/publictable';
Vue.component(publictable.name, publictable)
// 表单弹窗
import publicdialog from '@/components/publicdialog';
Vue.component(publicdialog.name, publicdialog)
// 过程表格
import ProcessTable from '@/components/ProcessTable';
Vue.component(ProcessTable.name, ProcessTable)

// import '@/icons' // icon
import '@/permission' // permission control
import dataV from '@jiaminghi/data-view'

Vue.use(dataV)
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

Vue.config.productionTip = false

// api管理
import api from '@/api'
import http from '@/utils/request'
// md5加密
import md5 from 'js-md5';
// 时刻
import moment from "moment"
// 进入工具js
import * as utils from "@/utils/utils"
// 引入iconfont.css
import '@/assets/iconfont/iconfont.css'

Vue.prototype.$moment = moment;
Vue.prototype.$api = api
Vue.prototype.http = http
Vue.prototype.md5 = md5
Vue.prototype.$utils = utils
export default new Vue({
  el: '#app',
  beforeCreate() {
    Vue.prototype.$bus = this
  },
  router,
  store,
  render: h => h(App)
})
